Performs processing on the IRecognitionForm on the page number and fields provided as parameters.
public void Recognize(
int recognitionPageNumber,
ITemplateForm templateForm,
int templatePageNumber,
IEnumerable<Field> fields
)
Public Sub Recognize(
ByVal recognitionPageNumber As Integer,
ByVal templateForm As ITemplateForm,
ByVal templatePageNumber As Integer,
ByVal fields As IEnumerable(Of Field
))
public:
void Recognize(
Int32 recognitionPageNumber,
ITemplateForm^ templateForm,
Int32 templatePageNumber,
IEnumerable<Field^>^ fields
)
recognitionPageNumber
Integer that represents the page number in the recognition form's Pages collection.
templateForm
The template form object.
templatePageNumber
Integer that represents the page number in the template form Pages collection.
fields
A generic collection of Field to be processed in this IRecognitionForm.
The results of recognizing the fields on this filled-in form can be accessed from the Field.Result property.
When the Recognize method is invoked, fields provided as a parameter are aligned and processed in the filled-in form.
The following example is a snippet of a larger example project. To run the larger example project, follow the work flow laid out in the OMREngine example. You can also download the complete example in Visual Studio 2017.
using Leadtools;
using Leadtools.Barcode;
using Leadtools.Codecs;
using Leadtools.Forms.Processing.Omr;
using Leadtools.Forms.Processing.Omr.Fields;
using Leadtools.Ocr;
public static List<IRecognitionForm> RecognizeMultipleForms(ITemplateForm template, OmrEngine engine)
{
string[] inputs = Directory.GetFiles(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\OMR Processing\Exam\filled\"));
List<IRecognitionForm> recognizedForms = new List<IRecognitionForm>();
// each filled form is recognized separately
for (int i = 0; i < inputs.Length; i++)
{
string fileToRecognize = inputs[i];
IRecognitionForm formToRecognize = engine.CreateRecognitionForm();
formToRecognize.Name = string.Format("Exam {0}", i + 1);
using (RasterImage fileToRecognizeImage = engine.EnginesObject.RasterCodecs.Load(fileToRecognize))
{
for (int j = 0; j < fileToRecognizeImage.PageCount; j++)
{
fileToRecognizeImage.Page = j + 1;
formToRecognize.Pages.AddPage(fileToRecognizeImage);
}
formToRecognize.Recognize(template);
}
for (int j = 0; j < formToRecognize.Pages[0].Fields.Count; j++)
{
OmrField field = formToRecognize.Pages[0].Fields[j] as OmrField;
if (field != null)
{
OmrFieldResult omrFieldResult = (OmrFieldResult)field.Result;
Console.Write(omrFieldResult.Text + "\t");
}
}
Console.WriteLine();
recognizedForms.Add(formToRecognize);
}
return recognizedForms;
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.